#pragma once
#include <bt/template/noncopyable.hpp>

namespace bt{
	// auto delete
	template<class T>
	class auto_delete : private noncopyable
	{
	public:
		explicit auto_delete(T* p)
			:_p(p)
		{

		}
		~auto_delete()
		{
			delete _p;
		}
		T* operator->()
		{
			return _p;
		}
	private:
		auto_delete();
		auto_delete(auto_delete&);
		T* _p;
	};

}